#include "mainwindow.h"
#include <QApplication>
#include <QSystemTrayIcon>
#include <QMessageBox>
#include <QTranslator>
#include <QDir>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QTranslator translator;
    translator.load(QString(":/qm/qserial_zh_CN"));
    a.installTranslator(&translator);

    MainWindow w;

    if (!QSystemTrayIcon::isSystemTrayAvailable()) {
        QMessageBox::critical(NULL, QObject::tr("系统托盘"), QObject::tr("不支持系统托盘"));
        return 1;
    }
    w.show();
    return a.exec();
}
